<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<!-- BEGIN HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
<!-- BEGIN CONTAINER -->
	<!-- BEGIN CONTENT -->
	<div ng-controller="activityRuleController">
		<div class="table_btn_box">
			<a class="btn blue" onClick="tableAdd(this,'editData');" ng-click="addInit();"><i class="fa fa-plus"></i>新增</a>
		</div>
		<table class="table table-striped table-bordered table-hover" id="table_1">
			<thead>
				<tr>
					<th>服务名称</th>
					<th>提供服务的运营商</th>
					<th>规则名称</th>
					<th>规则执行优先级</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<tr class="odd gradeX" ng-repeat="l in showList track by $index" on-loaded="{{$last}}" target-table="table_1">
					<td><span ng-bind="l.serviceName"></span></td>
					<td><span ng-bind="l.merchantName"></span></td>
					<td><span ng-bind="l.ruleName"></span></td>
					<td><span ng-bind="l.salience"></span></td>
					<td>
						<a class="btn" data-target="#editData" data-toggle="modal" ng-click="setInit(l);">修改</a>
						<a class="btn" ng-click="delInit(l);">删除</a>
					</td>
				</tr>
			</tbody>
		</table>
<div id="editData" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false">
	<div class="modal-dialog" style="width:1200px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h4 class="modal-title" ng-bind="openTitle"></h4>
			</div>
			<div class="modal-body form">
				<div class="form-group">
					<div class="row">
						<label class="col-sm-3 control-label text-right">服务名称</label>
						<div class="col-sm-9">
							<div class="input-group">
								<select ng-disabled="openTitle != '新增'" class="form-control bValidate" key="required"
									ng-options="subject.serviceNo as subject.name  for subject in showSeviceSelect "
									ng-model="edit.serviceNo">
									<option value="">--请选择服务--</option>
								</select>
							</div>
						</div>
					</div>
					<div class="row">
						<label class="col-sm-3 control-label text-right">提供服务的运营商</label>
						<div class="col-sm-9">
							<div class="input-group">
								<select ng-disabled="openTitle != '新增'" class="form-control bValidate" key="required"
									ng-options="subject.merchantCode as subject.name  for subject in showMerchantSelect "
									ng-model="edit.serviceProviderCode">
									<option value="">--请选择运营商--</option>
								</select>
							</div>
						</div>
					</div>
					<div class="row">
						<label class="col-sm-3 control-label text-right">规则名称</label>
						<div class="col-sm-9">
							<div class="input-group"><input title="规则名称不允许重复" ng-model="edit.ruleName" type="text" class="form-control bValidate" key="required,range_1-256"/></div>
						</div>
					</div>
					<div class="row">
						<label class="col-sm-3 control-label text-right">优先级</label>
						<div class="col-sm-9">
							<div class="input-group"><input ng-model="edit.salience" type="text" class="form-control bValidate" key="number,range_1-9"/></div>
						</div>
					</div>
					<div class="row">
						<label class="col-sm-3 control-label text-right">开始时间</label>
						<div class="col-sm-9">
							<div class="input-group"><input ng-model="edit.startDate" class="form-control getTime" data-format="yyyy-MM-dd HH:mm" type="text"/></div>
						</div>
					</div>
					<div class="row">
						<label class="col-sm-3 control-label text-right">结束时间</label>
						<div class="col-sm-9">
							<div class="input-group"><input ng-model="edit.endDate" class="form-control getTime" data-format="yyyy-MM-dd HH:mm" type="text"/></div>
						</div>
					</div>
					<div class="row">
						<label class="col-sm-3 control-label text-right">条件表达式</label>
						<div class="col-md-9">
							<div class="input-group">
								<textarea ng-model="edit.conditionalExpression" class="form-control bValidate" key="maxlength_1000" rows="5"></textarea>
							</div>
						</div>
					</div>
					<div class="row">
						<label class="col-sm-3 control-label text-right">业务表达式</label>
						<div class="col-md-9">
							<div class="input-group">
								<textarea ng-model="edit.bizExpression" class="form-control bValidate" key="maxlength_1000" rows="5"></textarea>
							</div>
						</div>
					</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-times"></i>关闭</button>
				<button type="submit" class="btn btn-primary" ng-click="editData();"><i class="fa fa-check"></i>保存</button>
			</div>
		</div>
	</div>
</div>
</div>
	<!-- END CONTENT -->
<!-- END CONTAINER -->
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->
</body>
<script>
$(function(){
	//绑定确认框
	$().bootboxWindow_confirm();
	//选择初始化
	$('.getTime').datetimepicker({
		language: 'zh-CN',
		pickDate: true,
		pickTime: true,
		hourStep: 1,
        minuteStep: 15,
        //secondStep: 30,
        inputMask: true,
		todayBtn: true,
		autoclose: true,
		minView: '0',
		forceParse: false,
		format: "yyyy-mm-dd HH:ii"
	});
	//自动完成初始化服务器数据
	//$('.autoCompleter').autocompleter({ source: 'path/to/get_data_request' });
	//自动完成初始化本地数据
	var data = [
	    { "value": "one", "label": "one" },
	    { "value": "two", "label": "two" },
	    { "value": "three", "label": "three" }
	];
	$(function () {
	    $('.autoCompleter').autocompleter({ source: data });
	});
 });
</script>
<!-- END BODY -->
</html>